home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1998 March / Pc Users extra 6.iso / pshare95 / prog / formula1 / vcform1.z / MainFrame.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-09-29  |  82.8 KB  |  2,265 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  4. Begin VB.MDIForm MainFrame 
  5.    BackColor       =   &H8000000C&
  6.    Caption         =   "MDIForm1"
  7.    ClientHeight    =   6900
  8.    ClientLeft      =   1905
  9.    ClientTop       =   1875
  10.    ClientWidth     =   10440
  11.    LinkTopic       =   "MDIForm1"
  12.    Begin ComctlLib.Toolbar tlbStandard 
  13.       Align           =   1  'Align Top
  14.       Height          =   420
  15.       Left            =   0
  16.       TabIndex        =   0
  17.       Top             =   0
  18.       Width           =   10440
  19.       _ExtentX        =   18415
  20.       _ExtentY        =   741
  21.       ButtonWidth     =   635
  22.       ButtonHeight    =   582
  23.       Appearance      =   1
  24.       ImageList       =   "ImageList2"
  25.       _Version        =   327680
  26.       BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7} 
  27.          NumButtons      =   18
  28.          BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  29.             Key             =   "New"
  30.             Object.ToolTipText     =   "New"
  31.             Object.Tag             =   ""
  32.             ImageIndex      =   1
  33.          EndProperty
  34.          BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  35.             Key             =   "Open"
  36.             Object.ToolTipText     =   "Open"
  37.             Object.Tag             =   ""
  38.             ImageIndex      =   2
  39.          EndProperty
  40.          BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  41.             Key             =   "Save"
  42.             Object.ToolTipText     =   "Save"
  43.             Object.Tag             =   ""
  44.             ImageIndex      =   3
  45.          EndProperty
  46.          BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  47.             Object.Tag             =   ""
  48.             Style           =   3
  49.             MixedState      =   -1  'True
  50.          EndProperty
  51.          BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  52.             Key             =   "Print"
  53.             Object.ToolTipText     =   "Print"
  54.             Object.Tag             =   ""
  55.             ImageIndex      =   4
  56.          EndProperty
  57.          BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  58.             Key             =   "Preview"
  59.             Object.ToolTipText     =   "Print Preview"
  60.             Object.Tag             =   ""
  61.             ImageIndex      =   5
  62.          EndProperty
  63.          BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  64.             Object.Tag             =   ""
  65.             Style           =   3
  66.             MixedState      =   -1  'True
  67.          EndProperty
  68.          BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  69.             Key             =   "Cut"
  70.             Object.ToolTipText     =   "Cut"
  71.             Object.Tag             =   ""
  72.             ImageIndex      =   6
  73.          EndProperty
  74.          BeginProperty Button9 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  75.             Key             =   "Copy"
  76.             Object.ToolTipText     =   "Copy"
  77.             Object.Tag             =   ""
  78.             ImageIndex      =   7
  79.          EndProperty
  80.          BeginProperty Button10 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  81.             Key             =   "Paste"
  82.             Object.ToolTipText     =   "Paste"
  83.             Object.Tag             =   ""
  84.             ImageIndex      =   8
  85.          EndProperty
  86.          BeginProperty Button11 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  87.             Key             =   "Painter"
  88.             Object.ToolTipText     =   "Format Painter"
  89.             Object.Tag             =   ""
  90.             ImageIndex      =   9
  91.          EndProperty
  92.          BeginProperty Button12 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  93.             Object.Tag             =   ""
  94.             Style           =   3
  95.             MixedState      =   -1  'True
  96.          EndProperty
  97.          BeginProperty Button13 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  98.             Key             =   "Draw"
  99.             Object.ToolTipText     =   "Drawing Toolbar"
  100.             Object.Tag             =   ""
  101.             ImageIndex      =   10
  102.          EndProperty
  103.          BeginProperty Button14 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  104.             Object.Tag             =   ""
  105.             Style           =   3
  106.             MixedState      =   -1  'True
  107.          EndProperty
  108.          BeginProperty Button15 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  109.             Enabled         =   0   'False
  110.             Key             =   "Spell"
  111.             Object.ToolTipText     =   "Spell Check"
  112.             Object.Tag             =   ""
  113.             ImageIndex      =   11
  114.          EndProperty
  115.          BeginProperty Button16 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  116.             Key             =   "Sum"
  117.             Object.ToolTipText     =   "Sum"
  118.             Object.Tag             =   ""
  119.             ImageIndex      =   12
  120.          EndProperty
  121.          BeginProperty Button17 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  122.             Key             =   "SortA"
  123.             Object.ToolTipText     =   "Sort Ascending"
  124.             Object.Tag             =   ""
  125.             ImageIndex      =   13
  126.          EndProperty
  127.          BeginProperty Button18 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  128.             Key             =   "SortD"
  129.             Object.ToolTipText     =   "Sort Descending"
  130.             Object.Tag             =   ""
  131.             ImageIndex      =   14
  132.          EndProperty
  133.       EndProperty
  134.    End
  135.    Begin ComctlLib.Toolbar tlbFormat 
  136.       Align           =   1  'Align Top
  137.       Height          =   420
  138.       Left            =   0
  139.       TabIndex        =   1
  140.       Top             =   420
  141.       Width           =   10440
  142.       _ExtentX        =   18415
  143.       _ExtentY        =   741
  144.       ButtonWidth     =   635
  145.       ButtonHeight    =   582
  146.       Appearance      =   1
  147.       ImageList       =   "ImageList3"
  148.       _Version        =   327680
  149.       BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7} 
  150.          NumButtons      =   18
  151.          BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  152.             Key             =   "FontName"
  153.             Object.Tag             =   ""
  154.             Style           =   4
  155.             Object.Width           =   2650
  156.             MixedState      =   -1  'True
  157.          EndProperty
  158.          BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  159.             Key             =   "Fontsize"
  160.             Object.Tag             =   ""
  161.             Style           =   4
  162.             Object.Width           =   1000
  163.             MixedState      =   -1  'True
  164.          EndProperty
  165.          BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  166.             Key             =   "Bold"
  167.             Object.ToolTipText     =   "Bold"
  168.             Object.Tag             =   ""
  169.             ImageIndex      =   1
  170.          EndProperty
  171.          BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  172.             Key             =   "Italics"
  173.             Object.ToolTipText     =   "Italics"
  174.             Object.Tag             =   ""
  175.             ImageIndex      =   2
  176.          EndProperty
  177.          BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  178.             Key             =   "Underline"
  179.             Object.ToolTipText     =   "Underline"
  180.             Object.Tag             =   ""
  181.             ImageIndex      =   3
  182.          EndProperty
  183.          BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  184.             Key             =   "Color"
  185.             Object.ToolTipText     =   "Text Color"
  186.             Object.Tag             =   ""
  187.             ImageIndex      =   4
  188.          EndProperty
  189.          BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  190.             Object.Tag             =   ""
  191.             Style           =   3
  192.             MixedState      =   -1  'True
  193.          EndProperty
  194.          BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  195.             Key             =   "Left"
  196.             Object.ToolTipText     =   "Left Justify"
  197.             Object.Tag             =   ""
  198.             ImageIndex      =   5
  199.          EndProperty
  200.          BeginProperty Button9 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  201.             Key             =   "Center"
  202.             Object.ToolTipText     =   "Center Justify"
  203.             Object.Tag             =   ""
  204.             ImageIndex      =   6
  205.          EndProperty
  206.          BeginProperty Button10 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  207.             Key             =   "Right"
  208.             Object.ToolTipText     =   "Right Justify"
  209.             Object.Tag             =   ""
  210.             ImageIndex      =   7
  211.          EndProperty
  212.          BeginProperty Button11 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  213.             Key             =   "Across"
  214.             Object.ToolTipText     =   "Center Across Cells"
  215.             Object.Tag             =   ""
  216.             ImageIndex      =   8
  217.          EndProperty
  218.          BeginProperty Button12 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  219.             Object.Tag             =   ""
  220.             Style           =   3
  221.             MixedState      =   -1  'True
  222.          EndProperty
  223.          BeginProperty Button13 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  224.             Object.Visible         =   0   'False
  225.             Key             =   "Fixed"
  226.             Object.ToolTipText     =   "Fixed and General"
  227.             Object.Tag             =   ""
  228.             ImageIndex      =   15
  229.          EndProperty
  230.          BeginProperty Button14 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  231.             Object.Visible         =   0   'False
  232.             Key             =   "Currency"
  233.             Object.ToolTipText     =   "Currency"
  234.             Object.Tag             =   ""
  235.             ImageIndex      =   10
  236.          EndProperty
  237.          BeginProperty Button15 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  238.             Object.Visible         =   0   'False
  239.             Key             =   "Percent"
  240.             Object.ToolTipText     =   "Percent"
  241.             Object.Tag             =   ""
  242.             ImageIndex      =   11
  243.          EndProperty
  244.          BeginProperty Button16 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  245.             Object.Visible         =   0   'False
  246.             Key             =   "Fraction"
  247.             Object.ToolTipText     =   "Fraction"
  248.             Object.Tag             =   ""
  249.             ImageIndex      =   12
  250.          EndProperty
  251.          BeginProperty Button17 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  252.             Object.Visible         =   0   'False
  253.             Key             =   "Date_time"
  254.             Object.ToolTipText     =   "Date/Time"
  255.             Object.Tag             =   ""
  256.             ImageIndex      =   13
  257.          EndProperty
  258.          BeginProperty Button18 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  259.             Object.Tag             =   ""
  260.             Style           =   4
  261.             Object.Width           =   1100
  262.             MixedState      =   -1  'True
  263.          EndProperty
  264.       EndProperty
  265.       Begin VB.ComboBox cboZoom 
  266.          Height          =   315
  267.          ItemData        =   "MainFrame.frx":0000
  268.          Left            =   6840
  269.          List            =   "MainFrame.frx":0013
  270.          TabIndex        =   6
  271.          Text            =   "100%"
  272.          Top             =   30
  273.          Width           =   975
  274.       End
  275.       Begin VB.ComboBox cboFontSize 
  276.          Height          =   315
  277.          ItemData        =   "MainFrame.frx":0032
  278.          Left            =   2600
  279.          List            =   "MainFrame.frx":0057
  280.          TabIndex        =   3
  281.          Text            =   "10"
  282.          Top             =   30
  283.          Width           =   975
  284.       End
  285.       Begin VB.ComboBox cboFontName 
  286.          Height          =   315
  287.          Left            =   120
  288.          Sorted          =   -1  'True
  289.          TabIndex        =   2
  290.          Text            =   "Arial"
  291.          Top             =   30
  292.          Width           =   2415
  293.       End
  294.    End
  295.    Begin ComctlLib.Toolbar tlbDraw 
  296.       Align           =   2  'Align Bottom
  297.       Height          =   420
  298.       Left            =   0
  299.       TabIndex        =   4
  300.       Top             =   6165
  301.       Visible         =   0   'False
  302.       Width           =   10440
  303.       _ExtentX        =   18415
  304.       _ExtentY        =   741
  305.       ButtonWidth     =   635
  306.       ButtonHeight    =   582
  307.       Appearance      =   1
  308.       ImageList       =   "ImageList1"
  309.       _Version        =   327680
  310.       BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7} 
  311.          NumButtons      =   12
  312.          BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  313.             Enabled         =   0   'False
  314.             Key             =   "PointEdit"
  315.             Object.ToolTipText     =   "Polygon Point Edit Mode"
  316.             Object.Tag             =   ""
  317.             ImageIndex      =   1
  318.          EndProperty
  319.          BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  320.             Object.Tag             =   ""
  321.             Style           =   3
  322.             MixedState      =   -1  'True
  323.          EndProperty
  324.          BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  325.             Key             =   "Line"
  326.             Object.ToolTipText     =   "Line Drawing Mode"
  327.             Object.Tag             =   ""
  328.             ImageIndex      =   2
  329.          EndProperty
  330.          BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  331.             Key             =   "Rectangle"
  332.             Object.ToolTipText     =   "Rectangle Drawing Mode"
  333.             Object.Tag             =   ""
  334.             ImageIndex      =   3
  335.          EndProperty
  336.          BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  337.             Key             =   "Oval"
  338.             Object.ToolTipText     =   "Oval Drawing Mode"
  339.             Object.Tag             =   ""
  340.             ImageIndex      =   4
  341.          EndProperty
  342.          BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  343.             Key             =   "Arc"
  344.             Object.ToolTipText     =   "Arc Drawing Mode"
  345.             Object.Tag             =   ""
  346.             ImageIndex      =   5
  347.          EndProperty
  348.          BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  349.             Key             =   "Polygon"
  350.             Object.ToolTipText     =   "Polygon Edit Mode"
  351.             Object.Tag             =   ""
  352.             ImageIndex      =   6
  353.          EndProperty
  354.          BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  355.             Object.Tag             =   ""
  356.             Style           =   3
  357.             MixedState      =   -1  'True
  358.          EndProperty
  359.          BeginProperty Button9 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  360.             Key             =   "Button"
  361.             Object.ToolTipText     =   "Button Drawing Mode"
  362.             Object.Tag             =   ""
  363.             ImageIndex      =   7
  364.          EndProperty
  365.          BeginProperty Button10 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  366.             Key             =   "Checkbox"
  367.             Object.ToolTipText     =   "Checkbox Drawing Mode"
  368.             Object.Tag             =   ""
  369.             ImageIndex      =   8
  370.          EndProperty
  371.          BeginProperty Button11 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  372.             Key             =   "Listbox"
  373.             Object.ToolTipText     =   "Listbox Drawing Mode"
  374.             Object.Tag             =   ""
  375.             ImageIndex      =   9
  376.          EndProperty
  377.          BeginProperty Button12 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  378.             Key             =   "Chart"
  379.             Object.ToolTipText     =   "Chart Drawing Mode"
  380.             Object.Tag             =   ""
  381.             ImageIndex      =   10
  382.          EndProperty
  383.       EndProperty
  384.    End
  385.    Begin MSComDlg.CommonDialog comdlg 
  386.       Left            =   3840
  387.       Top             =   3240
  388.       _ExtentX        =   847
  389.       _ExtentY        =   847
  390.       _Version        =   327680
  391.    End
  392.    Begin VB.Timer Timer1 
  393.       Interval        =   500
  394.       Left            =   6600
  395.       Top             =   2160
  396.    End
  397.    Begin ComctlLib.StatusBar sbar1 
  398.       Align           =   2  'Align Bottom
  399.       Height          =   315
  400.       Left            =   0
  401.       TabIndex        =   5
  402.       Top             =   6585
  403.       Width           =   10440
  404.       _ExtentX        =   18415
  405.       _ExtentY        =   556
  406.       SimpleText      =   ""
  407.       ShowTips        =   0   'False
  408.       _Version        =   327680
  409.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  410.          NumPanels       =   4
  411.          BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  412.             AutoSize        =   1
  413.             Bevel           =   0
  414.             Object.Width           =   13944
  415.             MinWidth        =   5080
  416.             TextSave        =   ""
  417.             Object.Tag             =   ""
  418.          EndProperty
  419.          BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  420.             Style           =   1
  421.             Alignment       =   1
  422.             AutoSize        =   2
  423.             Enabled         =   0   'False
  424.             Object.Width           =   1296
  425.             MinWidth        =   1305
  426.             TextSave        =   "CAPS"
  427.             Object.Tag             =   ""
  428.          EndProperty
  429.          BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  430.             Style           =   2
  431.             Alignment       =   1
  432.             AutoSize        =   2
  433.             Enabled         =   0   'False
  434.             Object.Width           =   1296
  435.             MinWidth        =   1305
  436.             TextSave        =   "NUM"
  437.             Object.Tag             =   ""
  438.          EndProperty
  439.          BeginProperty Panel4 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  440.             Style           =   4
  441.             Alignment       =   1
  442.             AutoSize        =   2
  443.             Enabled         =   0   'False
  444.             Object.Width           =   1296
  445.             MinWidth        =   1305
  446.             TextSave        =   "SCRL"
  447.             Object.Tag             =   ""
  448.          EndProperty
  449.       EndProperty
  450.    End
  451.    Begin ComctlLib.ImageList ImageList3 
  452.       Left            =   0
  453.       Top             =   1440
  454.       _ExtentX        =   1005
  455.       _ExtentY        =   1005
  456.       BackColor       =   -2147483643
  457.       ImageWidth      =   16
  458.       ImageHeight     =   16
  459.       MaskColor       =   12632256
  460.       _Version        =   327680
  461.       BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  462.          NumListImages   =   15
  463.          BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  464.             Picture         =   "MainFrame.frx":0086
  465.             Key             =   ""
  466.          EndProperty
  467.          BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  468.             Picture         =   "MainFrame.frx":0198
  469.             Key             =   ""
  470.          EndProperty
  471.          BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  472.             Picture         =   "MainFrame.frx":02AA
  473.             Key             =   ""
  474.          EndProperty
  475.          BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  476.             Picture         =   "MainFrame.frx":03BC
  477.             Key             =   ""
  478.          EndProperty
  479.          BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  480.             Picture         =   "MainFrame.frx":07C6
  481.             Key             =   ""
  482.          EndProperty
  483.          BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  484.             Picture         =   "MainFrame.frx":08D8
  485.             Key             =   ""
  486.          EndProperty
  487.          BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  488.             Picture         =   "MainFrame.frx":09EA
  489.             Key             =   ""
  490.          EndProperty
  491.          BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  492.             Picture         =   "MainFrame.frx":0AFC
  493.             Key             =   ""
  494.          EndProperty
  495.          BeginProperty ListImage9 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  496.             Picture         =   "MainFrame.frx":0DEE
  497.             Key             =   ""
  498.          EndProperty
  499.          BeginProperty ListImage10 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  500.             Picture         =   "MainFrame.frx":2C10
  501.             Key             =   ""
  502.          EndProperty
  503.          BeginProperty ListImage11 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  504.             Picture         =   "MainFrame.frx":3022
  505.             Key             =   ""
  506.          EndProperty
  507.          BeginProperty ListImage12 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  508.             Picture         =   "MainFrame.frx":3314
  509.             Key             =   ""
  510.          EndProperty
  511.          BeginProperty ListImage13 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  512.             Picture         =   "MainFrame.frx":363E
  513.             Key             =   ""
  514.          EndProperty
  515.          BeginProperty ListImage14 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  516.             Picture         =   "MainFrame.frx":3958
  517.             Key             =   ""
  518.          EndProperty
  519.          BeginProperty ListImage15 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  520.             Picture         =   "MainFrame.frx":4CC2
  521.             Key             =   ""
  522.          EndProperty
  523.       EndProperty
  524.    End
  525.    Begin ComctlLib.ImageList ImageList2 
  526.       Left            =   0
  527.       Top             =   840
  528.       _ExtentX        =   1005
  529.       _ExtentY        =   1005
  530.       BackColor       =   -2147483643
  531.       ImageWidth      =   16
  532.       ImageHeight     =   16
  533.       MaskColor       =   12632256
  534.       _Version        =   327680
  535.       BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  536.          NumListImages   =   15
  537.          BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  538.             Picture         =   "MainFrame.frx":68BC
  539.             Key             =   ""
  540.          EndProperty
  541.          BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  542.             Picture         =   "MainFrame.frx":69CE
  543.             Key             =   ""
  544.          EndProperty
  545.          BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  546.             Picture         =   "MainFrame.frx":6AC8
  547.             Key             =   ""
  548.          EndProperty
  549.          BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  550.             Picture         =   "MainFrame.frx":6BDA
  551.             Key             =   ""
  552.          EndProperty
  553.          BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  554.             Picture         =   "MainFrame.frx":6CEC
  555.             Key             =   ""
  556.          EndProperty
  557.          BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  558.             Picture         =   "MainFrame.frx":722E
  559.             Key             =   ""
  560.          EndProperty
  561.          BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  562.             Picture         =   "MainFrame.frx":7770
  563.             Key             =   ""
  564.          EndProperty
  565.          BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  566.             Picture         =   "MainFrame.frx":7CB2
  567.             Key             =   ""
  568.          EndProperty
  569.          BeginProperty ListImage9 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  570.             Picture         =   "MainFrame.frx":81F4
  571.             Key             =   ""
  572.          EndProperty
  573.          BeginProperty ListImage10 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  574.             Picture         =   "MainFrame.frx":8736
  575.             Key             =   ""
  576.          EndProperty
  577.          BeginProperty ListImage11 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  578.             Picture         =   "MainFrame.frx":8848
  579.             Key             =   ""
  580.          EndProperty
  581.          BeginProperty ListImage12 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  582.             Picture         =   "MainFrame.frx":8D8A
  583.             Key             =   ""
  584.          EndProperty
  585.          BeginProperty ListImage13 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  586.             Picture         =   "MainFrame.frx":8E9C
  587.             Key             =   ""
  588.          EndProperty
  589.          BeginProperty ListImage14 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  590.             Picture         =   "MainFrame.frx":8FAE
  591.             Key             =   ""
  592.          EndProperty
  593.          BeginProperty ListImage15 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  594.             Picture         =   "MainFrame.frx":90C0
  595.             Key             =   ""
  596.          EndProperty
  597.       EndProperty
  598.    End
  599.    Begin ComctlLib.ImageList ImageList1 
  600.       Left            =   120
  601.       Top             =   5640
  602.       _ExtentX        =   1005
  603.       _ExtentY        =   1005
  604.       BackColor       =   -2147483643
  605.       ImageWidth      =   16
  606.       ImageHeight     =   16
  607.       MaskColor       =   12632256
  608.       _Version        =   327680
  609.       BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  610.          NumListImages   =   10
  611.          BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  612.             Picture         =   "MainFrame.frx":9602
  613.             Key             =   ""
  614.          EndProperty
  615.          BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  616.             Picture         =   "MainFrame.frx":991C
  617.             Key             =   ""
  618.          EndProperty
  619.          BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  620.             Picture         =   "MainFrame.frx":9A2E
  621.             Key             =   ""
  622.          EndProperty
  623.          BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  624.             Picture         =   "MainFrame.frx":9B40
  625.             Key             =   ""
  626.          EndProperty
  627.          BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  628.             Picture         =   "MainFrame.frx":9C52
  629.             Key             =   ""
  630.          EndProperty
  631.          BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  632.             Picture         =   "MainFrame.frx":9D64
  633.             Key             =   ""
  634.          EndProperty
  635.          BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  636.             Picture         =   "MainFrame.frx":A07E
  637.             Key             =   ""
  638.          EndProperty
  639.          BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  640.             Picture         =   "MainFrame.frx":A398
  641.             Key             =   ""
  642.          EndProperty
  643.          BeginProperty ListImage9 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  644.             Picture         =   "MainFrame.frx":A6B2
  645.             Key             =   ""
  646.          EndProperty
  647.          BeginProperty ListImage10 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  648.             Picture         =   "MainFrame.frx":A9CC
  649.             Key             =   ""
  650.          EndProperty
  651.       EndProperty
  652.    End
  653.    Begin VB.Menu mnuFile 
  654.       Caption         =   "&File"
  655.       Begin VB.Menu mnuFileNew 
  656.          Caption         =   "&New"
  657.          Shortcut        =   ^N
  658.       End
  659.       Begin VB.Menu mnuFileOpen 
  660.          Caption         =   "&Open..."
  661.          Shortcut        =   ^O
  662.       End
  663.       Begin VB.Menu mnuFileClose 
  664.          Caption         =   "&Close"
  665.       End
  666.       Begin VB.Menu mnuFileSave 
  667.          Caption         =   "&Save"
  668.          Shortcut        =   ^S
  669.       End
  670.       Begin VB.Menu mnuFileSaveAs 
  671.          Caption         =   "Save &As..."
  672.       End
  673.       Begin VB.Menu mnuFileSep1 
  674.          Caption         =   "-"
  675.       End
  676.       Begin VB.Menu mnuFilePageSetup 
  677.          Caption         =   "Pa&ge Setup..."
  678.       End
  679.       Begin VB.Menu mnuFilePrintPreview 
  680.          Caption         =   "Print Pre&view"
  681.       End
  682.       Begin VB.Menu mnuFilePrint 
  683.          Caption         =   "&Print..."
  684.          Shortcut        =   ^P
  685.       End
  686.       Begin VB.Menu mnuFileSep2 
  687.          Caption         =   "-"
  688.       End
  689.       Begin VB.Menu mnuFileExit 
  690.          Caption         =   "E&xit"
  691.       End
  692.    End
  693.    Begin VB.Menu mnuEdit 
  694.       Caption         =   "&Edit"
  695.       Begin VB.Menu mnuEditCut 
  696.          Caption         =   "Cu&t"
  697.          Shortcut        =   ^X
  698.       End
  699.       Begin VB.Menu mnuEditCopy 
  700.          Caption         =   "&Copy"
  701.          Shortcut        =   ^C
  702.       End
  703.       Begin VB.Menu mnuEditPast 
  704.          Caption         =   "&Paste"
  705.          Shortcut        =   ^V
  706.       End
  707.       Begin VB.Menu mnuEditPasteSpecial 
  708.          Caption         =   "Paste &Special"
  709.          Enabled         =   0   'False
  710.       End
  711.       Begin VB.Menu mnuEditCopyCellFormat 
  712.          Caption         =   "Cop&y Cell Format"
  713.       End
  714.       Begin VB.Menu mnuEditSep1 
  715.          Caption         =   "-"
  716.       End
  717.       Begin VB.Menu mnuEditPolygonPoints 
  718.          Caption         =   "Polygo&n Points"
  719.          Enabled         =   0   'False
  720.       End
  721.       Begin VB.Menu mnuEditSelectAllObjects 
  722.          Caption         =   "Select All &Objects"
  723.          Enabled         =   0   'False
  724.       End
  725.       Begin VB.Menu mnuEditSep2 
  726.          Caption         =   "-"
  727.       End
  728.       Begin VB.Menu mnuEditSort 
  729.          Caption         =   "So&rt..."
  730.       End
  731.       Begin VB.Menu mnuEditFill 
  732.          Caption         =   "F&ill"
  733.          Begin VB.Menu mnuEditFillDown 
  734.             Caption         =   "&Down"
  735.             Shortcut        =   ^D
  736.          End
  737.          Begin VB.Menu mnuEditFillRight 
  738.             Caption         =   "&Right"
  739.             Shortcut        =   ^R
  740.          End
  741.       End
  742.       Begin VB.Menu mnuEditClear 
  743.          Caption         =   "Cle&ar"
  744.          Begin VB.Menu mnuEditClearAll 
  745.             Caption         =   "&All"
  746.          End
  747.          Begin VB.Menu mnuEditClearFormats 
  748.             Caption         =   "&Formats"
  749.          End
  750.          Begin VB.Menu mnuEditClearContents 
  751.             Caption         =   "&Contents"
  752.             Shortcut        =   {DEL}
  753.          End
  754.       End
  755.       Begin VB.Menu mnuEditDelete 
  756.          Caption         =   "&Delete..."
  757.       End
  758.       Begin VB.Menu mnuEditDeleteSheet 
  759.          Caption         =   "De&lete Sheet"
  760.          Enabled         =   0   'False
  761.       End
  762.       Begin VB.Menu mnuEditSep3 
  763.          Caption         =   "-"
  764.       End
  765.       Begin VB.Menu mnuEditFind 
  766.          Caption         =   "&Find..."
  767.          Shortcut        =   ^F
  768.       End
  769.       Begin VB.Menu mnuEditReplace 
  770.          Caption         =   "R&eplace"
  771.          Shortcut        =   ^H
  772.       End
  773.       Begin VB.Menu mnuEditGoTo 
  774.          Caption         =   "&Go To"
  775.          Shortcut        =   ^G
  776.       End
  777.    End
  778.    Begin VB.Menu mnuView 
  779.       Caption         =   "&View"
  780.       Begin VB.Menu mnuViewToolbars 
  781.          Caption         =   "&Toolbars"
  782.          Begin VB.Menu mnuViewToolbarsStandard 
  783.             Caption         =   "&Standard"
  784.             Checked         =   -1  'True
  785.          End
  786.          Begin VB.Menu mnuViewToolbarsFormatting 
  787.             Caption         =   "&Formatting"
  788.             Checked         =   -1  'True
  789.          End
  790.          Begin VB.Menu mnuViewToolbarsDrawing 
  791.             Caption         =   "&Drawing and Forms"
  792.          End
  793.       End
  794.       Begin VB.Menu mnuViewFormulaBar 
  795.          Caption         =   "&Formula Bar"
  796.          Checked         =   -1  'True
  797.       End
  798.       Begin VB.Menu mnuViewStatusBar 
  799.          Caption         =   "&Status Bar"
  800.          Checked         =   -1  'True
  801.       End
  802.    End
  803.    Begin VB.Menu mnuInsert 
  804.       Caption         =   "&Insert"
  805.       Begin VB.Menu mnuInsertCells 
  806.          Caption         =   "C&ells..."
  807.       End
  808.       Begin VB.Menu mnuInsertRows 
  809.          Caption         =   "&Rows"
  810.       End
  811.       Begin VB.Menu mnuInsertColumns 
  812.          Caption         =   "&Columns"
  813.       End
  814.       Begin VB.Menu mnuInsertWorksheet 
  815.          Caption         =   "&Worksheet"
  816.       End
  817.       Begin VB.Menu mnuInsertChart 
  818.          Caption         =   "C&hart"
  819.       End
  820.       Begin VB.Menu mnuInsertSep1 
  821.          Caption         =   "-"
  822.       End
  823.       Begin VB.Menu mnuInsertPageBreak 
  824.          Caption         =   "Page &Break"
  825.       End
  826.       Begin VB.Menu mnuInsertName 
  827.          Caption         =   "&Name..."
  828.       End
  829.       Begin VB.Menu mnuInsertSep2 
  830.          Caption         =   "-"
  831.       End
  832.       Begin VB.Menu mnuInsertDrawingObject 
  833.          Caption         =   "&Drawing Object"
  834.          Begin VB.Menu mnuInsertDOArc 
  835.             Caption         =   "&Arc"
  836.          End
  837.          Begin VB.Menu mnuInsertDOLine 
  838.             Caption         =   "&Line"
  839.          End
  840.          Begin VB.Menu mnuInsertDOOval 
  841.             Caption         =   "&Oval"
  842.          End
  843.          Begin VB.Menu mnuInsertDOPolygon 
  844.             Caption         =   "&Polygon"
  845.          End
  846.          Begin VB.Menu mnuInsertDORectangle 
  847.             Caption         =   "&Rectangle"
  848.          End
  849.       End
  850.       Begin VB.Menu mnuInsertFormsObject 
  851.          Caption         =   "&Forms Object"
  852.          Begin VB.Menu mnuInsertFOButton 
  853.             Caption         =   "&Button"
  854.          End
  855.          Begin VB.Menu mnuInsertFOCheckbox 
  856.             Caption         =   "&Checkbox"
  857.          End
  858.          Begin VB.Menu mnuInsertFOListbox 
  859.             Caption         =   "&Dropdown Listbox"
  860.          End
  861.       End
  862.       Begin VB.Menu mnuInsertSep3 
  863.          Caption         =   "-"
  864.       End
  865.       Begin VB.Menu mnuInsertCancel 
  866.          Caption         =   "C&ancel Insert Object"
  867.          Enabled         =   0   'False
  868.       End
  869.    End
  870.    Begin VB.Menu mnuFormat 
  871.       Caption         =   "F&ormat"
  872.       Begin VB.Menu mnuFormatCells 
  873.          Caption         =   "C&ells..."
  874.       End
  875.       Begin VB.Menu mnuFormatRow 
  876.          Caption         =   "&Row"
  877.          Begin VB.Menu mnuFormatRowHeight 
  878.             Caption         =   "H&eight..."
  879.          End
  880.          Begin VB.Menu mnuFormatRowHide 
  881.             Caption         =   "&Hide"
  882.          End
  883.          Begin VB.Menu mnuFormatRowUnhide 
  884.             Caption         =   "&Unhide"
  885.          End
  886.          Begin VB.Menu mnuFormatRowDefaultHgt 
  887.             Caption         =   "&Default Height..."
  888.          End
  889.       End
  890.       Begin VB.Menu mnuFormatColumn 
  891.          Caption         =   "&Column"
  892.          Begin VB.Menu mnuFormatColumnWidth 
  893.             Caption         =   "&Width..."
  894.          End
  895.          Begin VB.Menu mnuFormatColumnAutoFit 
  896.             Caption         =   "&AutoFit Selection"
  897.          End
  898.          Begin VB.Menu mnuFormatColumnHide 
  899.             Caption         =   "&Hide"
  900.          End
  901.          Begin VB.Menu mnuFormatColumnUnhide 
  902.             Caption         =   "&Unhide"
  903.          End
  904.          Begin VB.Menu mnuFormatColumnDefaultWdt 
  905.             Caption         =   "&Default Width..."
  906.          End
  907.       End
  908.       Begin VB.Menu mnuFormatSheet 
  909.          Caption         =   "S&heet"
  910.          Begin VB.Menu mnuFormatSheetProperties 
  911.             Caption         =   "&Properties..."
  912.          End
  913.          Begin VB.Menu mnuFormatSheetProtection 
  914.             Caption         =   "P&rotection"
  915.          End
  916.       End
  917.       Begin VB.Menu mnuFormatPrinting 
  918.          Caption         =   "&Printing"
  919.          Begin VB.Menu mnuFormatPrintArea 
  920.             Caption         =   "Set Print &Area"
  921.          End
  922.          Begin VB.Menu mnuFormatPrintTitles 
  923.             Caption         =   "Set Print &Titles"
  924.          End
  925.       End
  926.       Begin VB.Menu mnuFormatSep1 
  927.          Caption         =   "-"
  928.       End
  929.       Begin VB.Menu mnuFormatFreezePanes 
  930.          Caption         =   "&Freeze Panes"
  931.          Enabled         =   0   'False
  932.       End
  933.       Begin VB.Menu mnuFormatDefaultFont 
  934.          Caption         =   "&Default Font..."
  935.       End
  936.       Begin VB.Menu mnuFormatSep2 
  937.          Caption         =   "-"
  938.       End
  939.       Begin VB.Menu mnuFormatObject 
  940.          Caption         =   "&Object..."
  941.          Enabled         =   0   'False
  942.       End
  943.       Begin VB.Menu mnuFormatBringToFront 
  944.          Caption         =   "&Bring To Front"
  945.          Enabled         =   0   'False
  946.       End
  947.       Begin VB.Menu mnuFormatSendToBack 
  948.          Caption         =   "&Send To Back"
  949.          Enabled         =   0   'False
  950.       End
  951.    End
  952.    Begin VB.Menu mnuTools 
  953.       Caption         =   "&Tools"
  954.       Begin VB.Menu mnuToolsRecalc 
  955.          Caption         =   "Recalc"
  956.          Shortcut        =   {F9}
  957.       End
  958.       Begin VB.Menu mnuToolsOptions 
  959.          Caption         =   "&Options..."
  960.       End
  961.    End
  962.    Begin VB.Menu mnuWindow 
  963.       Caption         =   "&Window"
  964.       Begin VB.Menu mnuWindowNew 
  965.          Caption         =   "&New Window"
  966.       End
  967.       Begin VB.Menu mnuWindowCascade 
  968.          Caption         =   "&Cascade"
  969.       End
  970.       Begin VB.Menu mnuWindowTile 
  971.          Caption         =   "&Tile"
  972.       End
  973.       Begin VB.Menu mnuWindowArrangeIcons 
  974.          Caption         =   "&Arrange Icons"
  975.       End
  976.    End
  977.    Begin VB.Menu mnuHelp 
  978.       Caption         =   "&Help"
  979.       Begin VB.Menu mnuHelpAbout 
  980.          Caption         =   "&About SSMDI..."
  981.       End
  982.    End
  983.    Begin VB.Menu mnuFixed 
  984.       Caption         =   "Fixed"
  985.       Visible         =   0   'False
  986.       Begin VB.Menu mnuFixed0 
  987.          Caption         =   "0"
  988.       End
  989.       Begin VB.Menu mnuFixed0_0 
  990.          Caption         =   "0.0"
  991.       End
  992.       Begin VB.Menu mnuFixed0_00 
  993.          Caption         =   "0.00"
  994.       End
  995.    End
  996. Attribute VB_Name = "MainFrame"
  997. Attribute VB_GlobalNameSpace = False
  998. Attribute VB_Creatable = False
  999. Attribute VB_PredeclaredId = True
  1000. Attribute VB_Exposed = False
  1001. Dim Painterclick As Boolean
  1002. Private Sub SpellCheck()
  1003.     Dim lRow&, lCol&, lSheet&, lSR&, lER&, lSC&, lEC&
  1004.     Dim iCellType%, iSelection
  1005.     Dim tSelect As F1RangeRef
  1006.     VSSpell1.AutoPopup = True 'Let VisualSpeller handle the checking
  1007.     'Loop through all the columns and rows of all the selected sheets
  1008.     For lSheet = 1 To MainFrame.ActiveForm.ss.NumSheets
  1009.         If MainFrame.ActiveForm.ss.SheetSelected(lSheet) Then
  1010.             
  1011.             'Check to see if there is more than one selection.
  1012.             'If so, then we'll spell check only the words in the
  1013.             'selection(s).
  1014.             If MainFrame.ActiveForm.ss.SelectionCount > 1 Then
  1015.             
  1016.                 For iSelection = 0 To MainFrame.ActiveForm.ss.SelectionCount - 1
  1017.                     tSelect = MainFrame.ActiveForm.ss.SelectionEx(iSelection)
  1018.                     'Get the Selection 'Coordinates'
  1019.                     With tSelect
  1020.                         lSR = .StartRow
  1021.                         lER = .EndRow
  1022.                         lSC = .StartCol
  1023.                         lEC = .EndCol
  1024.                     End With
  1025.                     
  1026.                     For lRow = lSR To lER
  1027.                         For lCol = lSC To lEC
  1028.                             
  1029.                             iCellType = MainFrame.ActiveForm.ss.TypeSRC(lSheet, lRow, lCol)
  1030.                             If iCellType = 2 Then 'Text
  1031.                             
  1032.                                 VSSpell1.CheckText = MainFrame.ActiveForm.ss.TextSRC(lSheet, lRow, lCol)
  1033.                                 If VSSpell1.ResultCode = -3 Then
  1034.                                     Exit Sub
  1035.                                 End If
  1036.                                 MainFrame.ActiveForm.ss.TextSRC(lSheet, lRow, lCol) = VSSpell1.Text
  1037.                                 
  1038.                             End If
  1039.                             
  1040.                         Next lCol
  1041.                     Next lRow
  1042.                 Next iSelection
  1043.                 
  1044.             Else ' only one selection made..We'll cycle through that selection
  1045.                  ' or the whole sheet if there is only one cell selected.
  1046.                 Set tSelect = MainFrame.ActiveForm.ss.SelectionEx(0)
  1047.                 'Get the selection 'coordinates'
  1048.                 With tSelect
  1049.                     lSR = .StartRow
  1050.                     lER = .EndRow
  1051.                     lSC = .StartCol
  1052.                     lEC = .EndCol
  1053.                 End With
  1054.                 
  1055.                 If (lSR = lER And lSC = lEC) Then 'just single cell selected, check complete sheet(s)
  1056.                     
  1057.                     For lRow = 1 To MainFrame.ActiveForm.ss.LastRow
  1058.                         For lCol = 1 To MainFrame.ActiveForm.ss.LastCol
  1059.                             
  1060.                             iCellType = MainFrame.ActiveForm.ss.TypeSRC(lSheet, lRow, lCol)
  1061.                             'Check to see if the data in the cell is text, if so spell check it.
  1062.                             If iCellType = 2 Then
  1063.                                 'pass text in cell to spell checker
  1064.                                 VSSpell1.CheckText = MainFrame.ActiveForm.ss.TextSRC(lSheet, lRow, lCol)
  1065.                                 If VSSpell1.ResultCode = -3 Then 'Spell check was cancelled
  1066.                                     Exit Sub
  1067.                                 End If
  1068.                                 'pass checked text back into the cell
  1069.                                 MainFrame.ActiveForm.ss.TextSRC(lSheet, lRow, lCol) = VSSpell1.Text
  1070.                             End If
  1071.                             
  1072.                         Next lCol
  1073.                     Next lRow
  1074.                     
  1075.                 Else ' loop through selection
  1076.                 
  1077.                     For lRow = lSR To lER
  1078.                         For lCol = lSC To lEC
  1079.                         
  1080.                             iCellType = MainFrame.ActiveForm.ss.TypeSRC(lSheet, lRow, lCol)
  1081.                             If iCellType = 2 Then
  1082.                                 VSSpell1.CheckText = MainFrame.ActiveForm.ss.TextSRC(lSheet, lRow, lCol)
  1083.                                 If VSSpell1.ResultCode = -3 Then
  1084.                                     Exit Sub
  1085.                                 End If
  1086.                                 MainFrame.ActiveForm.ss.TextSRC(lSheet, lRow, lCol) = VSSpell1.Text
  1087.                             End If
  1088.                             
  1089.                         Next lCol
  1090.                     Next lRow
  1091.                     
  1092.                 End If
  1093.             End If
  1094.         End If
  1095.     Next lSheet
  1096.                 
  1097. End Sub
  1098. Private Sub cboFontName_Click()
  1099.    ''This Procedure will set the type of the font in the current cell(s) to the font that
  1100.    ''is entered in by the user, as long as it is non-empty and it is different from the previous font
  1101. On Error Resume Next
  1102.    If Not (MainFrame.ActiveForm Is Nothing) Then
  1103.       If Len(Trim$(cboFontName.Text)) > 0 Then
  1104.          MainFrame.ActiveForm.ss.FontName = cboFontName.Text
  1105.          MainFrame.ActiveForm.SetFocus
  1106.       End If
  1107.    End If
  1108. End Sub
  1109. Private Sub cboFontName_KeyPress(KeyAscii As Integer)
  1110.     If KeyAscii = 13 Then
  1111.         Call cboFontName_Click
  1112.     End If
  1113. End Sub
  1114. Private Sub cboFontName_LostFocus()
  1115.     Call cboFontName_Click
  1116. End Sub
  1117. Private Sub cboFontSize_Click()
  1118. On Error Resume Next
  1119.     If Not (MainFrame.ActiveForm Is Nothing) Then
  1120.         If Len(Trim$(cboFontSize.Text)) > 0 Then
  1121.             MainFrame.ActiveForm.ss.FontSize = CInt(Val(Trim$(cboFontSize.Text)))
  1122.             MainFrame.ActiveForm.ss.SetFocus
  1123.         End If
  1124.     End If
  1125. End Sub
  1126. Private Sub cboFontSize_KeyPress(KeyAscii As Integer)
  1127.     If KeyAscii = 13 Then
  1128.         Call cboFontSize_Click
  1129.     End If
  1130. End Sub
  1131. Private Sub cboFontSize_LostFocus()
  1132.     Call cboFontSize_Click
  1133. End Sub
  1134. Private Sub cboZoom_Click()
  1135.     If CInt(Val(cboZoom.Text)) > 10 And CInt(Val(cboZoom.Text)) < 400 Then
  1136.         MainFrame.ActiveForm.ss.ViewScale = CInt(Val(cboZoom.Text))
  1137.     Else
  1138.         MsgBox "View Scale must be between 10 and 400", vbOKCancel, "View Scale"
  1139.         cboZoom.Text = "100%"
  1140.     End If
  1141. End Sub
  1142. Private Sub cboZoom_KeyPress(KeyAscii As Integer)
  1143.     If KeyAscii = Asc(Chr$(13)) Then
  1144.         Call cboZoom_Click
  1145.     End If
  1146. End Sub
  1147. Private Sub cboZoom_LostFocus()
  1148.     Call cboZoom_Click
  1149. End Sub
  1150. Private Sub MDIForm_Activate()
  1151.     If SSIsActiveForm() Then
  1152.         MainFrame.ActiveForm.ss.SetFocus
  1153.     End If
  1154. End Sub
  1155. Private Sub MDIForm_Load()
  1156.     Dim lFont&
  1157.     For lFont = 0 To Screen.FontCount - 1
  1158.         cboFontName.AddItem Screen.Fonts(lFont)
  1159.     Next lFont
  1160.     Painterclick = False
  1161. End Sub
  1162. Private Sub mnuEditSelectAllObjects_Click()
  1163.     Dim ss As F1Book
  1164.     Dim objcount&, j&
  1165.     On Error Resume Next
  1166.     If SSIsActiveForm() Then
  1167.         Set ss = MainFrame.ActiveForm.ss
  1168.         j = ss.ObjFirstID
  1169.         ss.ObjSetSelection j
  1170.         On Error GoTo ObjSelectAll
  1171.         Do
  1172.             j = ss.ObjNextID(j)
  1173.             ss.ObjAddSelection j
  1174.         Loop
  1175.     End If
  1176. ObjSelectAll:
  1177.             
  1178. End Sub
  1179. Private Sub mnuFileExit_Click()
  1180.     End
  1181. End Sub
  1182. Private Sub mnuEdit_Click()
  1183.     Dim ss As F1Book
  1184.     Dim bObjectOnSheet As Boolean
  1185.     Dim lObjCount&, lCount&, lfirstid&
  1186.     Dim objtype As F1ObjTypeConstants
  1187.     Dim iSelected As Integer
  1188.     Dim rangeref As F1RangeRef
  1189.     If SSIsActiveForm() Then
  1190.         
  1191.         Set ss = MainFrame.ActiveForm.ss
  1192.         'Check to see if Paste is available in workbook
  1193.         If ss.CanEditPaste Then
  1194.             mnuEditPast.Enabled = True
  1195.         Else
  1196.             mnuEditPast.Enabled = False
  1197.         End If
  1198.         
  1199.         'check to see if special pasting can be done (i.e. paste f1 formats)
  1200.         If ss.CanEditPasteSpecial Then
  1201.             mnuEditPasteSpecial.Enabled = True
  1202.         Else
  1203.             mnuEditPasteSpecial.Enabled = False
  1204.         End If
  1205.         
  1206.         'if number of selected sheets = 1 then we can delete a sheet.  cannot uses
  1207.         'delete sheet method if more than one sheet in the book is selected.
  1208.         iSelected = 0
  1209.         
  1210.         For lCount = 1 To ss.NumSheets
  1211.             If ss.SheetSelected(lCount) Then
  1212.                 iSelected = iSelected + 1
  1213.             End If
  1214.         Next lCount
  1215.         
  1216.         If iSelected <> 1 Then
  1217.             mnuEditDeleteSheet.Enabled = False
  1218.         Else
  1219.             mnuEditDeleteSheet.Enabled = True
  1220.         End If
  1221.         
  1222.         'Check For enabling the PolyPoints and Select All object menu items.
  1223.         lObjCount = ss.ObjGetSelectionCount
  1224.         mnuEditSelectAllObjects.Enabled = True
  1225.         bObjectOnSheet = True
  1226.         On Error GoTo SelectAllCheck
  1227.         lfirstid = ss.ObjFirstID
  1228.         
  1229.         If bObjectOnSheet Then
  1230.             mnuEditSelectAllObjects.Enabled = True
  1231.             mnuEditDelete.Caption = "&Delete Object"
  1232.             mnuEditPolygonPoints.Enabled = False
  1233.             mnuEditFind.Enabled = False
  1234.             mnuEditReplace.Enabled = False
  1235.             mnuEditSort.Enabled = False
  1236.             mnuEditCopyCellFormat.Enabled = False
  1237.             If lObjCount = 1 Then
  1238.                 'if type is polygon then we can change the mode for polygon points or movement.
  1239.                 objid = ss.ObjSelection(0)
  1240.                 objtype = ss.ObjGetType(objid)
  1241.                 If objtype = F1ObjPolygon Then
  1242.                     mnuEditPolygonPoints.Enabled = True
  1243.                 Else
  1244.                     mnuEditPolygonPoints.Enabled = False
  1245.                 End If
  1246.             End If
  1247.                 
  1248.         Else 'no objects on sheet
  1249.             mnuEditSelectAllObjects.Enabled = False
  1250.             mnuEditDelete.Enabled = True
  1251.             mnuEditFind.Enabled = True
  1252.             mnuEditReplace.Enabled = True
  1253.             mnuEditPolygonPoints.Enabled = False
  1254.             mnuEditSort.Enabled = True
  1255.             mnuEditCopyCellFormat = True
  1256.             Set rangeref = ss.SelectionEx(0)
  1257.             
  1258.             If ss.SelectionCount = 1 Then
  1259.                 'check range for correct Delete caption.
  1260.                 If rangeref.EndCol <> 256 And rangeref.EndRow <> 16384 Then
  1261.                     mnuEditDelete.Caption = "&Delete..."
  1262.                 ElseIf rangeref.EndRow = 16384 And rangeref.EndCol = 256 Then
  1263.                     mnuEditDelete.Enabled = False
  1264.                 ElseIf rangeref.EndRow = 16384 Then
  1265.                     mnuEditDelete.Caption = "&Delete Columns"
  1266.                 ElseIf rangeref.EndCol = 256 Then
  1267.                     mnuEditDelete.Caption = "&Delete Rows"
  1268.                 End If
  1269.             Else
  1270.                 mnuEditDelete.Enabled = False
  1271.             End If
  1272.         End If
  1273.         Exit Sub
  1274.     End If
  1275. SelectAllCheck:
  1276.     bObjectOnSheet = False
  1277.     Resume Next
  1278. End Sub
  1279. Private Sub mnuEditClearAll_Click()
  1280.     Call C_Clear
  1281. End Sub
  1282. Private Sub mnuEditClearContents_Click()
  1283.    '' Clear the current value(s)
  1284.    On Local Error Resume Next
  1285.    If SSIsActiveForm() Then
  1286.       MainFrame.ActiveForm.ss.EditClear (F1ClearValues)
  1287.    End If
  1288. End Sub
  1289. Private Sub mnuEditClearFormats_Click()
  1290.    '' Clear the current format(s)
  1291.    On Local Error Resume Next
  1292.    If SSIsActiveForm() Then
  1293.       MainFrame.ActiveForm.ss.EditClear (F1ClearFormats)
  1294.    End If
  1295. End Sub
  1296. Private Sub mnuEditCopy_Click()
  1297.    Call C_Copy
  1298. End Sub
  1299. Private Sub mnuEditCopyCellFormat_Click()
  1300.     Call C_Copy
  1301. End Sub
  1302. Private Sub mnuEditCut_Click()
  1303.    Call C_Cut
  1304. End Sub
  1305. Private Sub mnuEditDelete_Click()
  1306.     Dim ss As F1Book
  1307.     Set ss = MainFrame.ActiveForm.ss
  1308.     If SSIsActiveForm() Then
  1309.         If mnuEditDelete.Caption = "&Delete..." Then
  1310.             ss.DeleteDlg
  1311.         ElseIf mnuEditDelete.Caption = "&Delete Object" Then
  1312.             ss.EditClear F1ClearAll
  1313.         ElseIf mnuEditDelete.Caption = "&Delete Rows" Then
  1314.             ss.EditDelete F1ShiftRows
  1315.         ElseIf mnuEditDelete.Caption = "&Delete Columns" Then
  1316.             ss.EditDelete F1ShiftCols
  1317.         End If
  1318.         
  1319.     End If
  1320. End Sub
  1321. Private Sub mnuEditDeleteSheet_Click()
  1322.    If SSIsActiveForm() Then
  1323.        MainFrame.ActiveForm.ss.EditDeleteSheets
  1324.    End If
  1325.    mnuEditDeleteSheet.Enabled = False
  1326. End Sub
  1327. Private Sub mnuEditFillDown_Click()
  1328.    If SSIsActiveForm() Then
  1329.        MainFrame.ActiveForm.ss.EditCopyDown
  1330.    End If
  1331. End Sub
  1332. Private Sub mnuEditFillRight_Click()
  1333.    If SSIsActiveForm() Then
  1334.        MainFrame.ActiveForm.ss.EditCopyRight
  1335.    End If
  1336. End Sub
  1337. Private Sub mnuEditFind_Click()
  1338.    If SSIsActiveForm() Then
  1339.        MainFrame.ActiveForm.ss.FindDlg
  1340.    End If
  1341. End Sub
  1342. Private Sub mnuEditGoTo_Click()
  1343.    If SSIsActiveForm() Then
  1344.       MainFrame.ActiveForm.ss.GotoDlg
  1345.    End If
  1346. End Sub
  1347. Private Sub mnuEditPast_Click()
  1348.    Call C_Paste
  1349. End Sub
  1350. Private Sub mnuEditPasteSpecial_Click()
  1351.     If SSIsActiveForm() Then
  1352.         MainFrame.ActiveForm.ss.EditPasteSpecial
  1353.     End If
  1354. End Sub
  1355. Private Sub mnuEditPolygonPoints_Click()
  1356.     If Not (MainFrame.ActiveForm Is Nothing) Then
  1357.         If MainFrame.ActiveForm.ss.PolyEditMode = F1PolyEditModeNormal Then
  1358.             MainFrame.ActiveForm.ss.PolyEditMode = F1PolyEditModePoints
  1359.             mnuEditPolygonPoints.Checked = True
  1360.         Else
  1361.             MainFrame.ActiveForm.ss.PolyEditMode = F1PolyEditModeNormal
  1362.             mnuEditPolygonPoints.Checked = False
  1363.         End If
  1364.     End If
  1365. End Sub
  1366. Private Sub mnuEditReplace_Click()
  1367.    If SSIsActiveForm() Then
  1368.        MainFrame.ActiveForm.ss.ReplaceDlg
  1369.    End If
  1370. End Sub
  1371. Private Sub mnuEditSort_Click()
  1372.    If SSIsActiveForm() Then                '' Open up the sort dialog box if there
  1373.        MainFrame.ActiveForm.ss.SortDlg     '' is a spreadsheet active
  1374.    End If
  1375. End Sub
  1376. Private Sub mnuFileClose_Click()
  1377.    If SSIsActiveForm() Then
  1378.       Unload MainFrame.ActiveForm
  1379.    End If
  1380. End Sub
  1381. Private Sub mnuFileNew_Click()
  1382.    Call C_New
  1383. End Sub
  1384. Private Sub mnuFileOpen_Click()
  1385.    Call SSMDIOpenFile("")
  1386. End Sub
  1387. Private Sub mnuFilePageSetup_Click()
  1388.    '' Open the page setup dialog box
  1389.    If SSIsActiveForm() Then
  1390.       MainFrame.ActiveForm.ss.FilePageSetupDlg
  1391.    End If
  1392. End Sub
  1393. Private Sub mnuFilePrint_Click()
  1394.    MainFrame.ActiveForm.ss.FilePrint True
  1395. End Sub
  1396. Private Sub mnuFilePrintPreview_Click()
  1397.    If SSIsActiveForm() Then
  1398.       MainFrame.ActiveForm.ss.FilePrintPreview
  1399.    End If
  1400. End Sub
  1401. Private Sub mnuFileSave_Click()
  1402.    Call C_Save
  1403. End Sub
  1404. Private Sub mnuFileSaveAs_Click()
  1405.     Dim response&
  1406.     If SSIsActiveForm() Then
  1407.        response = SSMDISaveAsFile
  1408.     End If
  1409. End Sub
  1410. Private Sub mnuFixed0_00_Click()
  1411.     If SSIsActiveForm() Then
  1412.         MainFrame.ActiveForm.ss.FormatFixed2
  1413.     End If
  1414. End Sub
  1415. Private Sub mnuFormat_Click()
  1416.     Dim ss As F1Book
  1417.     If SSIsActiveForm() Then
  1418.         Set ss = MainFrame.ActiveForm.ss
  1419.         If ss.FixedCols > 0 Or ss.FixedRows > 0 Then
  1420.             mnuFormatFreezePanes.Caption = "Un&freeze Panes"
  1421.         Else
  1422.             mnuFormatFreezePanes.Caption = "&Freeze Panes"
  1423.         End If
  1424.         If ss.ObjGetSelectionCount > 0 Then
  1425.             mnuFormatCells.Enabled = False
  1426.             mnuFormatRowHeight.Enabled = False
  1427.             mnuFormatRowHide.Enabled = False
  1428.             mnuFormatRowUnhide.Enabled = False
  1429.             mnuFormatColumnWidth.Enabled = False
  1430.             mnuFormatColumnAutoFit.Enabled = False
  1431.             mnuFormatColumnHide.Enabled = False
  1432.             mnuFormatColumnUnhide.Enabled = False
  1433.             mnuFormatFreezePanes.Enabled = False
  1434.             mnuFormatObject.Enabled = True
  1435.             mnuFormatBringToFront.Enabled = True
  1436.             mnuFormatSendToBack.Enabled = True
  1437.         Else
  1438.             mnuFormatCells.Enabled = True
  1439.             mnuFormatRowHeight.Enabled = True
  1440.             mnuFormatRowHide.Enabled = True
  1441.             mnuFormatRowUnhide.Enabled = True
  1442.             mnuFormatColumnWidth.Enabled = True
  1443.             mnuFormatColumnAutoFit.Enabled = True
  1444.             mnuFormatColumnHide.Enabled = True
  1445.             mnuFormatColumnUnhide.Enabled = True
  1446.             mnuFormatFreezePanes.Enabled = True
  1447.             mnuFormatObject.Enabled = False
  1448.             mnuFormatBringToFront.Enabled = False
  1449.             mnuFormatSendToBack.Enabled = False
  1450.         End If
  1451.     End If
  1452. End Sub
  1453. Private Sub mnuFormatBringToFront_Click()
  1454.     If SSIsActiveForm() Then
  1455.         MainFrame.ActiveForm.ss.ObjBringToFront
  1456.     End If
  1457.     mnuFormatBringToFront.Enabled = False
  1458. End Sub
  1459. Private Sub mnuFormatCells_Click()
  1460.     If SSIsActiveForm() Then
  1461.         MainFrame.ActiveForm.ss.FormatCellsDlg F1AllPages
  1462.         Call UpdateCBOFontAndSize   ' Update the font and size cbos
  1463.         Call UpdateAlignment        ' Set buttons according to selection alignment
  1464.     End If
  1465. End Sub
  1466. Private Sub mnuFormatColumnAutoFit_Click()
  1467.     Dim pSelection As F1RangeRef
  1468.     If SSIsActiveForm() Then
  1469.         Set pSelection = MainFrame.ActiveForm.ss.SelectionEx(0)
  1470.         MainFrame.ActiveForm.ss.SetColWidthAuto pSelection.StartRow, pSelection.StartCol, pSelection.EndRow, pSelection.EndCol, False
  1471.     End If
  1472. End Sub
  1473. Private Sub mnuFormatColumnDefaultWdt_Click()
  1474.     If SSIsActiveForm() Then
  1475.         MainFrame.ActiveForm.ss.DefColWidthDlg
  1476.     End If
  1477. End Sub
  1478. Private Sub mnuFormatColumnHide_Click()
  1479.     Dim pSelection As F1RangeRef
  1480.     If SSIsActiveForm() Then
  1481.         Set pSelection = MainFrame.ActiveForm.ss.SelectionEx(0)
  1482.         MainFrame.ActiveForm.ss.SetColHidden pSelection.StartCol, pSelection.EndCol, True
  1483.     End If
  1484. End Sub
  1485. Private Sub mnuFormatColumnUnhide_Click()
  1486.     Dim pSelection As F1RangeRef
  1487.     If ss Is ActiveForm() Then
  1488.         Set pSelection = MainFrame.ActiveForm.ss.SelectionEx(0)
  1489.         MainFrame.ActiveForm.ss.SetColHidden pSelection.StartCol, pSelection.EndCol, False
  1490.     End If
  1491. End Sub
  1492. Private Sub mnuFormatColumnWidth_Click()
  1493.     If SSIsActiveForm() Then
  1494.         MainFrame.ActiveForm.ss.ColWidthDlg
  1495.     End If
  1496. End Sub
  1497. Private Sub mnuFormatDefaultFont_Click()
  1498.     If SSIsActiveForm() Then
  1499.         MainFrame.ActiveForm.ss.FormatDefaultFontDlg
  1500.         Call UpdateCBOFontAndSize   ' Update the font and size cbos
  1501.         Call UpdateAlignment        ' Set buttons according to selection alignment
  1502.     End If
  1503. End Sub
  1504. Private Sub mnuFormatFreezePanes_Click()
  1505.     Dim pSelection As F1RangeRef
  1506.     Dim ss As F1Book
  1507.     Set ss = MainFrame.ActiveForm.ss
  1508.     If SSIsActiveForm() Then
  1509.         Set pSelection = MainFrame.ActiveForm.ss.SelectionEx(0)
  1510.         
  1511.         If ss.FixedCols > 0 Or ss.FixedRows > 0 Then 'UnFreeze Panes
  1512.             ss.FixedCols = 0
  1513.             ss.FixedRows = 0
  1514.             
  1515.         Else ' Fix the rows and/or cols
  1516.             'check for just one cell selection and fix both row and col.
  1517.             If pSelection.StartRow = pSelection.EndRow Then
  1518.                 If pSelection.StartCol = pSelection.EndCol Then
  1519.                     ss.FixedCol = 1
  1520.                     ss.FixedCols = pSelection.StartCol - 1
  1521.                     ss.FixedRow = 1
  1522.                     ss.FixedRows = pSelection.StartRow - 1
  1523.                     Exit Sub
  1524.                 End If
  1525.             End If
  1526.             
  1527.             If pSelection.EndRow = 16384 Then 'fix column(s)
  1528.                 ss.FixedCol = pSelection.StartCol
  1529.                 ss.FixedCols = pSelection.Cols
  1530.             
  1531.             ElseIf pSelection.EndCol = 256 Then 'fix rows
  1532.                 ss.FixedRow = pSelection.StartRow
  1533.                 ss.FixedRows = pSelection.Rows
  1534.                
  1535.             Else
  1536.                 MsgBox "Cannot fix cells or freeze panes based on the current selection."
  1537.                         
  1538.             End If
  1539.         End If
  1540.                 
  1541. End Sub
  1542. Private Sub mnuFormatObject_Click()
  1543.     If SSIsActiveForm() Then
  1544.         MainFrame.ActiveForm.ss.FormatObjectDlg F1AllPages
  1545.     End If
  1546.     mnuFormatObject.Enabled = False
  1547. End Sub
  1548. Private Sub mnuFormatPrintArea_Click()
  1549.     If SSIsActiveForm() Then
  1550.         MainFrame.ActiveForm.ss.SetPrintAreaFromSelection
  1551.     End If
  1552. End Sub
  1553. Private Sub mnuFormatPrintTitles_Click()
  1554.     If SSIsActiveForm() Then
  1555.         MainFrame.ActiveForm.ss.SetPrintTitlesFromSelection
  1556.     End If
  1557. End Sub
  1558. Private Sub mnuFormatRowDefaultHgt_Click()
  1559.     If SSIsActiveForm() Then
  1560.         MainFrame.ActiveForm.ss.DefRowHeightDlg
  1561.     End If
  1562. End Sub
  1563. Private Sub mnuFormatRowHeight_Click()
  1564.     If SSIsActiveForm() Then
  1565.         MainFrame.ActiveForm.ss.RowHeightDlg
  1566.     End If
  1567. End Sub
  1568. Private Sub mnuFormatRowHide_Click()
  1569.     Dim pSelection As F1RangeRef
  1570.     If SSIsActiveForm() Then
  1571.         Set pSelection = MainFrame.ActiveForm.ss.SelectionEx(0)
  1572.         MainFrame.ActiveForm.ss.SetRowHidden pSelection.StartRow, pSelection.EndRow, True
  1573.     End If
  1574. End Sub
  1575. Private Sub mnuFormatRowUnhide_Click()
  1576.     Dim pSelection As F1RangeRef
  1577.     If SSIsActiveForm() Then
  1578.         Set pSelection = MainFrame.ActiveForm.ss.SelectionEx(0)
  1579.         MainFrame.ActiveForm.ss.SetRowHidden pSelection.StartRow, pSelection.EndRow, False
  1580.     End If
  1581. End Sub
  1582. Private Sub mnuFormatSendToBack_Click()
  1583.     If SSIsActiveForm() Then
  1584.         MainFrame.ActiveForm.ss.ObjSendToBack
  1585.     End If
  1586.     mnuFormatSendToBack.Enabled = False
  1587. End Sub
  1588. Private Sub mnuFormatSheetProperties_Click()
  1589.     If SSIsActiveForm() Then
  1590.         MainFrame.ActiveForm.ss.FormatSheetDlg F1AllPages, False
  1591.     End If
  1592. End Sub
  1593. Private Sub mnuFormatSheetProtection_Click()
  1594.     If SSIsActiveForm() Then
  1595.         MainFrame.ActiveForm.ss.EnableProtection = Not MainFrame.ActiveForm.ss.EnableProtection
  1596.         If MainFrame.ActiveForm.ss.EnableProtection Then
  1597.             mnuFormatSheetProtection.Checked = True
  1598.         Else
  1599.             mnuFormatSheetProtection.Checked = False
  1600.         End If
  1601.     End If
  1602. End Sub
  1603. Private Sub mnuInsert_Click()
  1604.     Dim ss As F1Book
  1605.     Set ss = MainFrame.ActiveForm.ss
  1606.     If ss.Mode <> F1ModeNormal Then
  1607.         mnuInsertCancel.Enabled = True
  1608.     End If
  1609.     If ss.ObjGetSelectionCount > 0 Then
  1610.         mnuInsertCells.Enabled = False
  1611.         mnuInsertRows.Enabled = False
  1612.         mnuInsertColumns.Enabled = False
  1613.         mnuInsertPageBreak.Enabled = False
  1614.     Else
  1615.         mnuInsertCells.Enabled = True
  1616.         mnuInsertRows.Enabled = True
  1617.         mnuInsertColumns.Enabled = True
  1618.         mnuInsertPageBreak.Enabled = True
  1619.     End If
  1620. End Sub
  1621. Private Sub mnuInsertCancel_Click()
  1622.    If SSIsActiveForm() Then
  1623.       MainFrame.ActiveForm.ss.Mode = F1ModeNormal
  1624.    End If
  1625.    mnuInsertCancel.Enabled = False
  1626. End Sub
  1627. Private Sub mnuInsertCells_Click()
  1628.     On Local Error Resume Next
  1629.     If SSIsActiveForm() Then
  1630.         MainFrame.ActiveForm.ss.InsertDlg
  1631.     End If
  1632. End Sub
  1633. Private Sub mnuInsertChart_Click()
  1634.    If SSIsActiveForm() Then
  1635.       MainFrame.ActiveForm.ss.Mode = F1ModeChart
  1636.       tlbDraw.Buttons.Item(12).Value = tbrPressed
  1637.    End If
  1638. End Sub
  1639. Private Sub mnuInsertColumns_Click()
  1640.     On Local Error Resume Next
  1641.     If SSIsActiveForm() Then
  1642.         MainFrame.ActiveForm.ss.EditInsert F1ShiftCols
  1643.     End If
  1644. End Sub
  1645. Private Sub mnuInsertDOArc_Click()
  1646.    If SSIsActiveForm() Then
  1647.       MainFrame.ActiveForm.ss.Mode = F1ModeArc
  1648.       tlbDraw.Buttons.Item(6).Value = tbrPressed
  1649.    End If
  1650. End Sub
  1651. Private Sub mnuInsertDOLine_Click()
  1652.    If SSIsActiveForm() Then
  1653.       MainFrame.ActiveForm.ss.Mode = F1ModeLine
  1654.       tlbDraw.Buttons.Item(3).Value = tbrPressed
  1655.    End If
  1656. End Sub
  1657. Private Sub mnuInsertDOOval_Click()
  1658.    If SSIsActiveForm() Then
  1659.       MainFrame.ActiveForm.ss.Mode = F1ModeOval
  1660.       tlbDraw.Buttons.Item(5).Value = tbrPressed
  1661.       
  1662.    End If
  1663. End Sub
  1664. Private Sub mnuInsertDOPolygon_Click()
  1665.    If SSIsActiveForm() Then
  1666.       MainFrame.ActiveForm.ss.Mode = F1ModePolygon
  1667.       tlbDraw.Buttons.Item(7).Value = tbrPressed
  1668.    End If
  1669. End Sub
  1670. Private Sub mnuInsertDORectangle_Click()
  1671.    If SSIsActiveForm() Then
  1672.       MainFrame.ActiveForm.ss.Mode = F1ModeRectangle
  1673.       tlbDraw.Buttons.Item(4).Value = tbrPressed
  1674.       
  1675.    End If
  1676. End Sub
  1677. Private Sub mnuInsertFOButton_Click()
  1678.    If SSIsActiveForm() Then
  1679.       MainFrame.ActiveForm.ss.Mode = F1ModeButton
  1680.       tlbDraw.Buttons.Item(9).Value = tbrPressed
  1681.    End If
  1682. End Sub
  1683. Private Sub mnuInsertFOCheckbox_Click()
  1684.    If SSIsActiveForm() Then
  1685.       MainFrame.ActiveForm.ss.Mode = F1ModeCheckBox
  1686.       tlbDraw.Buttons.Item(10).Value = tbrPressed
  1687.    End If
  1688. End Sub
  1689. Private Sub mnuInsertFOListbox_Click()
  1690.    If SSIsActiveForm() Then
  1691.       MainFrame.ActiveForm.ss.Mode = F1ModeDropDown
  1692.       tlbDraw.Buttons.Item(11).Value = tbrPressed
  1693.    End If
  1694. End Sub
  1695. Private Sub mnuInsertName_Click()
  1696.    '' Activate the dialog box to define names for cells
  1697.     If SSIsActiveForm() Then
  1698.          MainFrame.ActiveForm.ss.DefinedNameDlg
  1699.     End If
  1700. End Sub
  1701. Private Sub mnuInsertPageBreak_Click()
  1702.     On Error Resume Next
  1703.     If SSIsActiveForm() Then
  1704.         MainFrame.ActiveForm.ss.AddPageBreak
  1705.     End If
  1706. End Sub
  1707. Private Sub mnuInsertRows_Click()
  1708.     On Error Resume Next
  1709.     If SSIsActiveForm() Then
  1710.         MainFrame.ActiveForm.ss.EditInsert F1ShiftRows
  1711.     End If
  1712. End Sub
  1713. Private Sub mnuInsertWorksheet_Click()
  1714.    On Error Resume Next
  1715.    If SSIsActiveForm() Then
  1716.       MainFrame.ActiveForm.ss.EditInsertSheets
  1717.    End If
  1718. End Sub
  1719. Private Sub mnuToolsOptions_Click()
  1720.     If SSIsActiveForm() Then
  1721.         MainFrame.ActiveForm.ss.OptionsDlg F1AllPages
  1722.     End If
  1723. End Sub
  1724. Private Sub mnuToolsRecalc_Click()
  1725.     If SSIsActiveForm() Then
  1726.         MainFrame.ActiveForm.ss.CheckRecalc
  1727.     End If
  1728. End Sub
  1729. Private Sub mnuViewFormulaBar_Click()
  1730.     mnuViewFormulaBar.Checked = Not mnuViewFormulaBar.Checked
  1731.     If mnuViewFormulaBar.Checked Then
  1732.         MainFrame.ActiveForm.ss.ShowEditBar = True
  1733.     Else
  1734.         MainFrame.ActiveForm.ss.ShowEditBar = False
  1735.     End If
  1736. End Sub
  1737. Private Sub mnuViewStatusBar_Click()
  1738.     sbar1.Visible = Not sbar1.Visible
  1739.     mnuViewStatusBar.Checked = Not mnuViewStatusBar.Checked
  1740. End Sub
  1741. Private Sub mnuViewToolbarsDrawing_Click()
  1742.     tlbDraw.Visible = Not tlbDraw.Visible
  1743.     mnuViewToolbarsDrawing.Checked = Not mnuViewToolbarsDrawing.Checked
  1744.     If mnuViewToolbarsDrawing.Checked Then
  1745.         tlbStandard.Buttons.Item(13).Value = tbrPressed
  1746.     Else
  1747.         tlbStandard.Buttons.Item(13).Value = tbrUnpressed
  1748.     End If
  1749. End Sub
  1750. Private Sub mnuViewToolbarsFormatting_Click()
  1751.     mnuViewToolbarsFormatting.Checked = Not mnuViewToolbarsFormatting.Checked
  1752.     If mnuViewToolbarsFormatting.Checked Then
  1753.         tlbFormat.Visible = True
  1754.     Else
  1755.         tlbFormat.Visible = False
  1756.     End If
  1757. End Sub
  1758. Private Sub mnuViewToolbarsStandard_Click()
  1759.     mnuViewToolbarsStandard.Checked = Not mnuViewToolbarsStandard.Checked
  1760.     If mnuViewToolbarsStandard.Checked Then
  1761.         tlbStandard.Visible = True
  1762.     Else
  1763.         tlbStandard.Visible = False
  1764.     End If
  1765. End Sub
  1766. Private Sub mnuWindowArrangeIcons_Click()
  1767.     MainFrame.Arrange 3
  1768. End Sub
  1769. Private Sub mnuWindowCascade_Click()
  1770.     MainFrame.Arrange 0
  1771. End Sub
  1772. Private Sub mnuWindowNew_Click()
  1773.     Call C_New
  1774. End Sub
  1775. Private Sub mnuWindowTile_Click()
  1776.     MainFrame.Arrang 1
  1777. End Sub
  1778. Private Sub Timer1_Timer()
  1779.     '' This raises all buttons when the last sheet is closed.
  1780.     '' Set the timer interval so that the user won't notice
  1781.     '' any delay during normal operations.
  1782.     Dim i%
  1783.     Dim objid&
  1784.     Dim ss As F1Book
  1785.     If SSIsActiveForm() Then
  1786.         Set ss = MainFrame.ActiveForm.ss
  1787.     End If
  1788.     'Timer1.Enabled = False
  1789.     If MainFrame.ActiveForm Is Nothing Then
  1790.         
  1791.         For i = 1 To tlbFormat.Buttons.Count
  1792.             tlbFormat.Buttons.Item(i).Value = tbrUnpressed
  1793.         Next i
  1794.         
  1795.         For i = 1 To tlbStandard.Buttons.Count - 1
  1796.             tlbFormat.Buttons.Item(i).Value = tbrUnpressed
  1797.         Next i
  1798.         
  1799.         For i = 1 To tlbDraw.Buttons.Count
  1800.             tlbDraw.Buttons.Item(i).Value = tbrUnpressed
  1801.         Next i
  1802.         
  1803.     Else
  1804.         If ss.ObjGetSelectionCount = 1 Then 'only one object is selected
  1805.             'Get Selected Object's ID
  1806.             ss.ObjGetSelection 0, objid
  1807.             'Check to see if polyedit mode button should be enabled.
  1808.             If ss.ObjGetType(objid) = F1ObjPolygon Then
  1809.                 tlbDraw.Buttons.Item(1).Enabled = True
  1810.                 'Debug.Print "PolyEditMode should be enabled"
  1811.             Else
  1812.                 tlbDraw.Buttons.Item(1).Enabled = False
  1813.             End If
  1814.             tlbFormat.Enabled = False
  1815.             For i = 16 To 18 ' disable sum and sort buttons
  1816.                 tlbStandard.Buttons.Item(i).Enabled = False
  1817.             Next i
  1818.             'Debug.Print objid, ss.ObjGetType(objid)
  1819.         Else
  1820.             tlbFormat.Enabled = True
  1821.             tlbDraw.Buttons.Item(1).Enabled = False
  1822.             For i = 16 To 18 ' disable sum and sort buttons.
  1823.                 tlbStandard.Buttons.Item(i).Enabled = True
  1824.             Next i
  1825.         End If
  1826.         
  1827.         If ss.CanEditPaste Then 'enable paste button
  1828.             tlbStandard.Buttons.Item(10).Enabled = True
  1829.         Else
  1830.             tlbStandard.Buttons.Item(10).Enabled = False
  1831.         End If
  1832.     End If
  1833. End Sub
  1834. Private Sub tlbDraw_ButtonClick(ByVal Button As ComctlLib.Button)
  1835.     Dim ss As F1Book
  1836.     Dim i%
  1837.         
  1838.     If Not (MainFrame.ActiveForm Is Nothing) Then
  1839.         Set ss = MainFrame.ActiveForm.ss
  1840.         Select Case Button.key
  1841.             
  1842.             Case "PointEdit"
  1843.                 If ss.PolyEditMode = F1PolyEditModePoints Then
  1844.                     Button.Value = tbrUnpressed
  1845.                     ss.PolyEditMode = F1PolyEditModeNormal
  1846.                     mnuEditPolygonPoints.Checked = False
  1847.                 Else
  1848.                     Button.Value = tbrPressed
  1849.                     ss.PolyEditMode = F1PolyEditModePoints
  1850.                     mnuEditPolygonPoints.Checked = True
  1851.                 End If
  1852.                             
  1853.             Case "Line"
  1854.                 If ss.Mode <> F1ModeLine Then
  1855.                     For i = 3 To MainFrame.tlbDraw.Buttons.Count
  1856.                         MainFrame.tlbDraw.Buttons.Item(i).Value = tbrUnpressed
  1857.                     Next i
  1858.                     Button.Value = tbrPressed
  1859.                     ss.Mode = F1ModeLine
  1860.                 ElseIf ss.Mode = F1ModeLine Then
  1861.                     Button.Value = tbrUnpressed
  1862.                     ss.Mode = F1ModeNormal
  1863.                 End If
  1864.                 
  1865.             Case "Rectangle"
  1866.                 If ss.Mode <> F1ModeRectangle Then
  1867.                     For i = 3 To MainFrame.tlbDraw.Buttons.Count
  1868.                         MainFrame.tlbDraw.Buttons.Item(i).Value = tbrUnpressed
  1869.                     Next i
  1870.                     Button.Value = tbrPressed
  1871.                     ss.Mode = F1ModeRectangle
  1872.                 ElseIf ss.Mode = F1ModeRectangle Then
  1873.                     Button.Value = tbrUnpressed
  1874.                     ss.Mode = F1ModeNormal
  1875.                 End If
  1876.                 
  1877.             Case "Oval"
  1878.                 If ss.Mode <> F1ModeOval Then
  1879.                     For i = 3 To MainFrame.tlbDraw.Buttons.Count
  1880.                         MainFrame.tlbDraw.Buttons.Item(i).Value = tbrUnpressed
  1881.                     Next i
  1882.                     Button.Value = tbrPressed
  1883.                     ss.Mode = F1ModeOval
  1884.                 ElseIf ss.Mode = F1ModeOval Then
  1885.                     Button.Value = tbrUnpressed
  1886.                     ss.Mode = F1ModeNormal
  1887.                 End If
  1888.                 
  1889.             Case "Arc"
  1890.                 If ss.Mode <> F1ModeArc Then
  1891.                     For i = 3 To MainFrame.tlbDraw.Buttons.Count
  1892.                         MainFrame.tlbDraw.Buttons.Item(i).Value = tbrUnpressed
  1893.                     Next i
  1894.                     Button.Value = tbrPressed
  1895.                     ss.Mode = F1ModeArc
  1896.                 ElseIf ss.Mode = F1ModeArc Then
  1897.                     Button.Value = tbrUnpressed
  1898.                     ss.Mode = F1ModeNormal
  1899.                 End If
  1900.                 
  1901.             Case "Polygon"
  1902.                 If ss.Mode <> F1ModePolygon Then
  1903.                     For i = 3 To MainFrame.tlbDraw.Buttons.Count
  1904.                         MainFrame.tlbDraw.Buttons.Item(i).Value = tbrUnpressed
  1905.                     Next i
  1906.                     Button.Value = tbrPressed
  1907.                     ss.Mode = F1ModePolygon
  1908.                 ElseIf ss.Mode = F1ModePolygon Then
  1909.                     Button.Value = tbrUnpressed
  1910.                     ss.Mode = F1ModeNormal
  1911.                 End If
  1912.                 
  1913.             Case "Button"
  1914.                 If ss.Mode <> F1ModeButton Then
  1915.                     For i = 3 To MainFrame.tlbDraw.Buttons.Count
  1916.                         MainFrame.tlbDraw.Buttons.Item(i).Value = tbrUnpressed
  1917.                     Next i
  1918.                     Button.Value = tbrPressed
  1919.                     ss.Mode = F1ModeButton
  1920.                 ElseIf ss.Mode = F1ModeButton Then
  1921.                     Button.Value = tbrUnpressed
  1922.                     ss.Mode = F1ModeNormal
  1923.                 End If
  1924.                 
  1925.             Case "Checkbox"
  1926.                 If ss.Mode <> F1ModeCheckBox Then
  1927.                     For i = 3 To MainFrame.tlbDraw.Buttons.Count
  1928.                         MainFrame.tlbDraw.Buttons.Item(i).Value = tbrUnpressed
  1929.                     Next i
  1930.                     Button.Value = tbrPressed
  1931.                     ss.Mode = F1ModeCheckBox
  1932.                 ElseIf ss.Mode = F1ModeCheckBox Then
  1933.                     Button.Value = tbrUnpressed
  1934.                     ss.Mode = F1ModeNormal
  1935.                 End If
  1936.                 
  1937.             Case "Listbox"
  1938.                 If ss.Mode <> F1ModeDropDown Then
  1939.                     For i = 3 To MainFrame.tlbDraw.Buttons.Count
  1940.                         MainFrame.tlbDraw.Buttons.Item(i).Value = tbrUnpressed
  1941.                     Next i
  1942.                     Button.Value = tbrPressed
  1943.                     ss.Mode = F1ModeDropDown
  1944.                 ElseIf ss.Mode = F1ModeDropDown Then
  1945.                     Button.Value = tbrUnpressed
  1946.                     ss.Mode = F1ModeNormal
  1947.                 End If
  1948.                 
  1949.             Case "Chart"
  1950.                 If ss.Mode <> F1ModeChart Then
  1951.                     For i = 3 To MainFrame.tlbDraw.Buttons.Count
  1952.                         MainFrame.tlbDraw.Buttons.Item(i).Value = tbrUnpressed
  1953.                     Next i
  1954.                     Button.Value = tbrPressed
  1955.                     ss.Mode = F1ModeChart
  1956.                 ElseIf ss.Mode = F1ModeChart Then
  1957.                     Button.Value = tbrUnpressed
  1958.                     ss.Mode = F1ModeNormal
  1959.                 End If
  1960.                 
  1961.         End Select
  1962.         ss.SetFocus
  1963.     End If
  1964.             
  1965. End Sub
  1966. Private Sub tlbFormat_ButtonClick(ByVal Button As ComctlLib.Button)
  1967.     Dim ss As F1Book
  1968.     'Do nothing if no child form is active.
  1969.     If Not (MainFrame.ActiveForm Is Nothing) Then
  1970.         Set ss = MainFrame.ActiveForm.ss
  1971.         Select Case Button.key
  1972.             
  1973.             Case "Bold"
  1974.                 If Not ss.FontBold Then
  1975.                     ss.FontBold = True
  1976.                     Button.Value = tbrPressed
  1977.                 Else
  1978.                     ss.FontBold = False
  1979.                     Button.Value = tbrUnpressed
  1980.                 End If
  1981.                             
  1982.             Case "Italics"
  1983.                 If Not ss.FontItalic Then
  1984.                     ss.FontItalic = True
  1985.                     Button.Value = tbrPressed
  1986.                 Else
  1987.                     ss.FontItalic = False
  1988.                     Button.Value = tbrUnpressed
  1989.                 End If
  1990.                 
  1991.             Case "Underline"
  1992.                 If Not ss.FontUnderline Then
  1993.                     ss.FontUnderline = True
  1994.                     Button.Value = tbrPressed
  1995.                 Else
  1996.                     ss.FontUnderline = False
  1997.                     Button.Value = tbrUnpressed
  1998.                 End If
  1999.             
  2000.             Case "Color"
  2001.                 comdlg.ShowColor
  2002.                 ss.FontColor = comdlg.Color
  2003.                 
  2004.             Case "Left"
  2005.                 If ss.HAlign <> F1HAlignLeft Then
  2006.                     ss.HAlign = F1HAlignLeft
  2007.                     Button.Value = tbrPressed
  2008.                     tlbFormat.Buttons.Item(9).Value = tbrUnpressed
  2009.                     tlbFormat.Buttons.Item(10).Value = tbrUnpressed
  2010.                     tlbFormat.Buttons.Item(11).Value = tbrUnpressed
  2011.                 Else
  2012.                     ss.HAlign = F1HAlignGeneral
  2013.                     Button.Value = tbrUnpressed
  2014.                 End If
  2015.             
  2016.             Case "Center"
  2017.                 If ss.HAlign <> F1HAlignCenter Then
  2018.                     ss.HAlign = F1HAlignCenter
  2019.                     Button.Value = tbrPressed
  2020.                     tlbFormat.Buttons.Item(8).Value = tbrUnpressed
  2021.                     tlbFormat.Buttons.Item(10).Value = tbrUnpressed
  2022.                     tlbFormat.Buttons.Item(11).Value = tbrUnpressed
  2023.                 Else
  2024.                     ss.HAlign = F1HAlignGeneral
  2025.                     Button.Value = tbrUnpressed
  2026.                 End If
  2027.                 
  2028.             Case "Right"
  2029.                 If ss.HAlign <> F1HAlignRight Then
  2030.                     ss.HAlign = F1HAlignRight
  2031.                     Button.Value = tbrPressed
  2032.                     tlbFormat.Buttons.Item(8).Value = tbrUnpressed
  2033.                     tlbFormat.Buttons.Item(9).Value = tbrUnpressed
  2034.                     tlbFormat.Buttons.Item(11).Value = tbrUnpressed
  2035.                 Else
  2036.                     ss.HAlign = F1HAlignGeneral
  2037.                     Button.Value = tbrUnpressed
  2038.                 End If
  2039.                 
  2040.             Case "Across"
  2041.                 If ss.HAlign <> F1HAlignCenterAcrossCells Then
  2042.                     ss.HAlign = F1HAlignCenterAcrossCells
  2043.                     Button.Value = tbrPressed
  2044.                     tlbFormat.Buttons.Item(8).Value = tbrUnpressed
  2045.                     tlbFormat.Buttons.Item(9).Value = tbrUnpressed
  2046.                     tlbFormat.Buttons.Item(10).Value = tbrUnpressed
  2047.                 Else
  2048.                     ss.HAlign = F1HAlignGeneral
  2049.                     Button.Value = tbrUnpressed
  2050.                 End If
  2051.             
  2052.             Case "Fixed"
  2053.                 PopupMenu mnuFixed
  2054.                 
  2055.             Case "Currency"
  2056.             
  2057.             Case "Percent"
  2058.             
  2059.             Case "Fraction"
  2060.             
  2061.             Case "Date_time"
  2062.         
  2063.         End Select
  2064.                 
  2065.         ss.SetFocus
  2066.     End If
  2067. End Sub
  2068. Private Sub tlbStandard_ButtonClick(ByVal Button As ComctlLib.Button)
  2069.     Dim ss As F1Book
  2070.     Dim lRow&, lCol&
  2071.     Dim iTypeAbove%, iTypeLeft%
  2072.     Dim rc1$, rc2$
  2073.     Dim r1&, r2&, c1&, c2&
  2074.     Dim rangeref As F1RangeRef
  2075.     Dim bFlag As Boolean
  2076.     If Not (MainFrame.ActiveForm Is Nothing) Then
  2077.         Set ss = MainFrame.ActiveForm.ss
  2078.     End If
  2079.  Select Case Button.key
  2080.      Case "New"
  2081.          Button.Value = tbrPressed
  2082.          C_New
  2083.          Button.Value = tbrUnpressed
  2084.          
  2085.      Case "Open"
  2086.          Button.Value = tbrPressed
  2087.          Call SSMDIOpenFile("")
  2088.          Button.Value = tbrUnpressed
  2089.          
  2090.      Case "Save"
  2091.         If Not (MainFrame.ActiveForm Is Nothing) Then
  2092.             Button.Value = tbrPressed
  2093.             Call C_Save
  2094.             Button.Value = tbrUnpressed
  2095.         End If
  2096.          
  2097.      Case "Print"
  2098.         If Not (MainFrame.ActiveForm Is Nothing) Then
  2099.             Button.Value = tbrPressed
  2100.             ss.FilePrint False
  2101.             Button.Value = tbrUnpressed
  2102.         End If
  2103.         
  2104.      Case "Preview"
  2105.         If Not (MainFrame.ActiveForm Is Nothing) Then
  2106.             Button.Value = tbrPressed
  2107.             If SSIsActiveForm() Then
  2108.                ss.FilePrintPreview
  2109.             End If
  2110.             Button.Value = tbrUnpressed
  2111.         End If
  2112.      
  2113.      Case "Cut"
  2114.         If Not (MainFrame.ActiveForm Is Nothing) Then
  2115.             Call C_Cut
  2116.         End If
  2117.          
  2118.      Case "Copy"
  2119.         If Not (MainFrame.ActiveForm Is Nothing) Then
  2120.             Call C_Copy
  2121.         End If
  2122.          
  2123.      Case "Paste"
  2124.         If Not (MainFrame.ActiveForm Is Nothing) Then
  2125.             Call C_Paste
  2126.         End If
  2127.          
  2128.      Case "Painter"
  2129.          ' Turn the format painter flag on.
  2130.          ' The actual format painting code is in the SelChange and
  2131.          ' the MouseUp events.
  2132.                
  2133.          If Not (MainFrame.ActiveForm Is Nothing) Then
  2134.              
  2135.             ' If there is no cell selection then skip
  2136.             ' This could happen if a drawing object is selected
  2137.             If FormatPainterFlag = 0 Then
  2138.                 Button.Value = tbrPressed
  2139.                 Painterclick = True
  2140.                 If ss.SelectionCount = 0 Then
  2141.                     Beep
  2142.                 Else
  2143.                     ' Set the Format Painter Flag for use later and copy the
  2144.                     ' current selection's formatting
  2145.                     FormatPainterFlag = 1
  2146.                     ss.EditCopy
  2147.                     
  2148.                     ' Change the mousepointer to signify we are in
  2149.                     ' Format Painter Mode.
  2150.                    ' ss.MousePointer = f1MouseCustom
  2151.                 End If
  2152.             Else
  2153.                 Button.Value = tbrUnpressed
  2154.                 FormatPainterFlag = 0
  2155.                 Painterclick = False
  2156.                 'ss.MousePointer = f1Default
  2157.             End If
  2158.              
  2159.              ss.SetFocus
  2160.          End If
  2161.          
  2162.      Case "Draw"
  2163.          Call mnuViewToolbarsDrawing_Click
  2164.              
  2165.          
  2166.      Case "Spell"
  2167.         If Not (MainFrame.ActiveForm Is Nothing) Then
  2168.             'Button.Value = tbrPressed
  2169.             'Call SpellCheck
  2170.             'Button.Value = tbrUnpressed
  2171.             MsgBox "VisualSpeller must be installed for this option to work."
  2172.             Button.Value = tbrUnpressed
  2173.             Button.Enabled = False
  2174.         End If
  2175.          
  2176.      Case "Sum"
  2177.         If Not (MainFrame.ActiveForm Is Nothing) Then
  2178.             lRow = ss.Row
  2179.             lCol = ss.Col
  2180.             iTypeAbove = ss.TypeRC(lRow - 1, lCol)
  2181.             iTypeLeft = ss.TypeRC(lRow, lCol - 1)
  2182.             
  2183.             If (iTypeAbove = 0 And iTypeLeft = 0) Then 'not sure what is to be summed
  2184.                 ss.Formula = "Sum"
  2185.                 ss.StartEdit False, True, True
  2186.                                 
  2187.             ElseIf iTypeAbove = 0 And iTypeLeft <> 0 Then 'sum values to the left
  2188.                 rc2 = ss.FormatRCNr(lRow, lCol - 1, False)
  2189.                 lCol = lCol - 1
  2190.                 
  2191.                 Do
  2192.                     lCol = lCol - 1
  2193.                     iTypeLeft = ss.TypeRC(lRow, lCol)
  2194.                     If iTypeLeft = 1 Or iTypeLeft = -1 Or iTypeLeft = 4 Or iTypeLeft = -4 Then
  2195.                         bFlag = False
  2196.                     Else
  2197.                         bFlag = True
  2198.                     End If
  2199.                 Loop Until (lCol = 1 Or bFlag)
  2200.                 
  2201.                 rc1 = ss.FormatRCNr(lRow, lCol + 1, False)
  2202.                 'Enter Formula
  2203.                 ss.Formula = "Sum(" & rc1 & ":" & rc2 & ")"
  2204.                 
  2205.                 'Set selection of the Formula
  2206.                 ss.Selection = rc1 & ":" & rc2
  2207.                 ss.SetFocus
  2208.             
  2209.             Else 'sum values above
  2210.                 rc2 = ss.FormatRCNr(lRow - 1, lCol, False)
  2211.                 lRow = lRow - 1
  2212.                 
  2213.                 Do
  2214.                     lRow = lRow - 1
  2215.                     iTypeAbove = ss.TypeRC(lRow, lCol)
  2216.                     If iTypeAbove = 1 Or iTypeAbove = -1 Or iTypeAbove = 4 Or iTypeAbove = -4 Then
  2217.                         bFlag = False
  2218.                     Else
  2219.                         bFlag = True
  2220.                     End If
  2221.                 Loop Until (lRow = 1 Or bFlag)
  2222.                 
  2223.                 rc1 = ss.FormatRCNr(lRow + 1, lCol, False)
  2224.                 
  2225.                 ss.Formula = "Sum(" & rc1 & ":" & rc2 & ")"
  2226.                 ss.Selection = rc2 & ":" & rc1
  2227.                 
  2228.                 ss.SetFocus
  2229.             
  2230.             End If
  2231.             Button.Value = tbrUnpressed
  2232.         End If
  2233.      Case "SortA", "SortD"
  2234.         If Not (MainFrame.ActiveForm Is Nothing) Then
  2235.             Set rangeref = ss.SelectionEx(0)
  2236.             With rangeref
  2237.                 r1 = .StartRow
  2238.                 r2 = .EndRow
  2239.                 c1 = .StartCol
  2240.                 c2 = .EndCol
  2241.             End With
  2242.             If Button.key = "SortA" Then
  2243.                 ss.Sort3 r1, c1, r2, c2, True, 1, 0, 0
  2244.             Else 'button.key = "sortD"
  2245.                 ss.Sort3 r1, c1, r2, c2, True, -1, 0, 0
  2246.             End If
  2247.             Button.Value = tbrUnpressed
  2248.         End If
  2249.      End Select
  2250.      
  2251.      If Not (MainFrame.ActiveForm Is Nothing) Then
  2252.         MainFrame.ActiveForm.ss.SetFocus
  2253.      End If
  2254. End Sub
  2255. Private Sub tlbStandard_DblClick()
  2256.     'since the MS toolbar doesn't accept doubleclick messages when over buttons _
  2257.     and there is not a button dbl click event, the format painter cannot function _
  2258.     like excel when double clicking on the format painter button.  The format _
  2259.     will only work on one selection at a time.
  2260. '    If FormatPainterFlag > 0 And Painterclick Then
  2261. '        FormatPainterFlag = 3
  2262. '        tlbStandard.Buttons.Item(11).Value = tbrPressed
  2263. '    End If
  2264. End Sub
  2265.